package com.rc.saas.tenant.service.fault;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.rc.saas.tenant.mapper.fault.RcElecPileFaultRecordMapper;
import com.rc.saas.tenant.model.fault.RcElecPileFaultRecord;
import com.rc.saas.tenant.search.fault.RcElecPileFaultRecordSearch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by sven on 2018-04-17
 */
@Service
public class RcElecPileFaultRecordServiceImpl implements RcElecPileFaultRecordService {

    @Autowired
    private RcElecPileFaultRecordMapper rcElecPileFaultRecordMapper;


    @Override
    public RcElecPileFaultRecordMapper getMapper() {
        return rcElecPileFaultRecordMapper;
    }


    @Override
    public PageInfo<RcElecPileFaultRecord> listPageByCondition(RcElecPileFaultRecordSearch rcElecPileFaultRecordSearch) {
        PageHelper.startPage(rcElecPileFaultRecordSearch.getOffset(), rcElecPileFaultRecordSearch.getLimit());
        List<RcElecPileFaultRecord> rcElecPileFaultRecords =  rcElecPileFaultRecordMapper.listPageByCondition(rcElecPileFaultRecordSearch);
        return new PageInfo<RcElecPileFaultRecord>(rcElecPileFaultRecords);
    }


}
